package com.cy.pj.eiems.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.cy.pj.eiems.common.annotation.RequiredLog;
import com.cy.pj.eiems.entity.EiemsLog;
import com.cy.pj.eiems.service.EiemsLogService;
import com.cy.pj.eiems.vo.JsonResult;
import com.cy.pj.eiems.vo.PageObject;


@RestController
@RequestMapping("/log/")
public class EiemsLogController {
	@Autowired
	private EiemsLogService eiemsLogService;

	@RequestMapping("doDeleteObjects")
	@ResponseBody
	public JsonResult doDeleteObjects(Integer... ids) {
		eiemsLogService.deleteObjects(ids);
		return new JsonResult("delete ok");
	}
	
	@RequiredLog("查询操作")
	@RequestMapping("doFindPageObjects")
	@ResponseBody
	public JsonResult doFindPageObjects(String username, Integer pageCurrent) {
		PageObject<EiemsLog> pageObject = eiemsLogService.findPageObjects(username, pageCurrent);
		return new JsonResult(pageObject);
	}

}
